function test() {
	//測試用例
	var _test_arr = [
		[ { userId:1000, type:'call', num:20 }, { userId:1001, type:'allIn', num:8 }, { userId:1234, type:'call', num:20 }, { userId:1002, type:'allIn', num:20 } ],
		[ { userId:1000, type:'call', num:20 }, { userId:1001, type:'allIn', num:8 }, { userId:1234, type:'call', num:20 }, { userId:1002, type:'allIn', num:20 } ],
		[ { userId:10, type:'call', num:30 }, { userId:9, type:'allIn', num:9 }, { userId:30, type:'fold', num:20 }, { userId:23, type:'allIn', num:20 } ]
		
	];
	//測試彩池總數
	var _test_pot = [68, 68,79];
	//預期結果
	var _test_res = [
		[ { user:[1000, 1001, 1002, 1234], pot:32 }, { user:[1000, 1002, 1234], pot:36 } ],
		[ { user:[1000, 1001, 1002, 1234], pot:32 }, { user:[1000, 1002, 1234], pot:36 } ],
		[ { user:[10,23,9], pot:36 }, { user:[10, 23], pot:33 }, { user:[10], pot:10 } ]
		
	]
	//開始測試：獨立測試
	var action = new Action();
	for ( var i in _test_arr ) {		
		action.debugInit(_test_arr[i], _test_pot[i]);
		var _test = action.formatBet();
		for ( var v in _test) {			
			if ( _test[v]._pot != _test_res[i][v].pot ) {
				__out.println("Pot failed in test " + i );
				break;
			}
			trace("the pot is "+_test[v]._pot);
			var _testUser = _test[v]._userArr;
			var _test_user = _test_res[i][v].user;
			var _msg = '';
			for (var m in _testUser ) {
				if ( _testUser[m] != _test_user[m] ) {
					__out.println("User failed in test " + i+" and user:" + _testUser[m]);
				}
				_msg += _testUser[m]+","
			} 
			trace(_msg);
		}
		__out.println(" Well Done at " + i);
		action.restart();
	}	
}

//完美封包
function Person(name) {
	this.name = name;
	this.pass = "pass";	
	if (Person.prototype.say == undefined) {
		Person.prototype.say = function() {
			trace("I am " + this.name);
		}
    }
}